<template>
	<div class="demo-date-picker">
		<div class="block">
			<span class="demonstration">Picker with quick options</span>
			<el-date-picker v-model="value2" type="date" placeholder="请选择一个日期" @change="change" :shortcuts="shortcuts"
				:size="large" value-format="YYYY-MM-DD" />
		</div>
	</div>
</template>

<script >

export default {

	data() {
		return {
			value2: "",
			shortcuts: [
				{
					text: '今天',
					value: new Date(),
				},
				{
					text: '昨天',
					value: () => {
						const date = new Date()
						date.setTime(date.getTime() - 3600 * 1000 * 24)
						return date
					},
				},
				{
					text: '一周前',
					value: () => {
						const date = new Date()
						date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
						return date
					},
				},
			]
		}
	},
	methods: {
		change(value) {
			console.log(value)
		}

	}
}

</script>

<style>
.item {
	position: absolute;
	z-index: 999;
}
</style>